package com.hzqy.persistence.dao.epg;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.hzqy.persistence.dao.core.PersistenceDao;
import com.hzqy.web.vo.epg.ActivityProductVo;

import java.util.List;
import java.util.Map;

@Repository
public class AcProductDao extends PersistenceDao<ActivityProductVo, Integer>{
	protected final Logger LOG = LoggerFactory.getLogger(getClass());
	public Integer selectAcCount(ActivityProductVo ac){
        return getSqlSession().selectOne(this.getNamespace()+"selectAcCount",ac);
    }
	/*
	*  更新信息
	* */
	public int updateAc(ActivityProductVo activityProductVo){
		return getSqlSession().update(this.getNamespace() + "updateAc", activityProductVo);
	}
	/*
	* 动态查询信息传递实体为参数
	* */
	public List<ActivityProductVo> selectByRequest(ActivityProductVo acp){
       return getSqlSession().selectList(this.getNamespace()+"selectByRequest",acp);
	}
	/*
	*  查询单个信息根据id
	* */
	public ActivityProductVo selectActivity(int f_ap_id){
		return getSqlSession().selectOne(this.getNamespace() + "selectActivity",f_ap_id);
	}
	/*
	*  查询一定量的数据信息
	* */
	public List<ActivityProductVo> selectAc(Map param){
		return getSqlSession().selectList(this.getNamespace() + "selectAcProduct",param);
	}
	/*
	*  伪删除
	* */
	public int deleteAc(ActivityProductVo apv) {
		return getSqlSession().update(this.getNamespace()+ "deleteAc",apv);
	}
   /*
   *  插入信息
   * */
	public int insertAc(ActivityProductVo apv) {
		return getSqlSession().insert(this.getNamespace() +"insertAc", apv);
	}
}
